import Vue from 'vue'
import Router from 'vue-router'
import plateNumber from '@/components/plateNumber'
// import parkRecord from '@/components/parkRecord'
import dynCodePay from '@/components/dynCodePay'
import parkEnter from '@/components/parkEnter'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      redirect: {
        name: 'plateNumber'
      }
    },
    // {
    //   path: '/navigation',
    //   name: 'navigation',
    //   component: navigation
    // },
    {
      path: '/parkEnter',
      name: 'parkEnter',
      component: parkEnter,
      meta: {
        title: '月卡购买'
      }
    },
    {
      path: '/plateNumber',
      name: 'plateNumber',
      component: plateNumber,
      meta: {
        title: '月卡购买'
      }
    },

    {
      path: '/cardList',
      name: 'cardList',
      component: () => import("@/components/cardList.vue"),
      meta: {
        title: '我的月卡'
      }
    },

    {
      path: '/buyCard',
      name: 'buyCard',
      component: () => import("@/components/buyCard.vue"),
      meta: {
        title: '购买会员卡'
      }
    },

    {
      path: '/buyCardList',
      name: 'buyCardList',
      component: () => import("@/components/buyCardList.vue"),
      meta: {
        title: '购买会员卡'
      }
    },

    {
      path: '/bill',
      name: 'bill',
      component: () => import("@/components/bill.vue"),
      meta: {
        title: '开发票'
      }
    },

    {
      path: '/billMsg',
      name: 'billMsg',
      component: () => import("@/components/billMsg.vue"),
      meta: {
        title: '申请成功'
      }
    }






    // {
    //   path: '/parkRecord',
    //   name: 'parkRecord',
    //   component: parkRecord
    // },
    // {
    //   path: '/orderPay',
    //   name: 'orderPay',
    //   component: () => import("@/components/orderPay.vue")
    // },

    // {
    //   path: '/payResult',
    //   name: 'payResult',
    //   component: () => import("@/components/payResult.vue")
    // },
    //
    //
    // {
    //   path: '/dynCodePay',
    //   name: 'dynCodePay',
    //   component: () => import("@/components/dynCodePay.vue"),
    //   meta: {
    //     title: '西荣通顺'
    //   }
    // },
    //
    // {
    //   path: '/pay',
    //   name: 'pay',
    //   component: () => import("@/components/pay.vue")
    // },
    //
    // {
    //   path: '/noPass',
    //   name: 'noPass',
    //   component: () => import("@/components/noPass.vue")
    // },


  ]
})

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

export default router


